import 'dart:core';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
void main() {
  runApp(
    MaterialApp(home: TextHomePage()),
  );
}

class TextHomePage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return TextHomePageState();
  }
}

class TextHomePageState extends State<TextHomePage> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: Scaffold(
            appBar: AppBar(
              title: const Text("listview"),
            ),
            body: GestureDetector(
              onTapDown:(event){
                print("手指按下${event}");
                print(event.globalPosition);
              },
              onTapUp: (event){
                print("手指抬起${event}");
                print(event.globalPosition);
              },
              onTapCancel: (){
                print("返回");
              },
              onTap: (){
                print("点击");
              },
              onDoubleTap: (){
                print("双击");
              },
              onLongPress: (){
                print("长按时间");
              },
              child: Center(
                child: Container(
                  width: 300,
                  color: Colors.red,
                  height: 300,
                ),
              ),
            )
        )
    );
  }
}
